using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace Rally_Dekstop
{
    public class TestCase
    {
        private string id;
        private string testref;
        private string name;
        private string description;
        private string notes;
        private string objective;
        private string type;
        private string method;
        private string priority;
        private string risk;
        private string package;
        private string preConditions;
        private string postConditions;
        private string validationInput;
        private string validationExpectedResult;
        private string owner;
        private string lastVerdict;
        private string lastBuild;

        public TestCase()
        {
            this.id = string.Empty;
            this.testref = string.Empty;
            this.name = string.Empty;
            this.description = string.Empty;
            this.notes = string.Empty;
            this.objective = string.Empty;
            this.type = string.Empty;
            this.method = string.Empty;
            this.priority = string.Empty;
            this.risk = string.Empty;
            this.package = string.Empty;
            this.preConditions = string.Empty;
            this.postConditions = string.Empty;
            this.validationInput = string.Empty;
            this.validationExpectedResult = string.Empty;
            this.owner = string.Empty;
            this.lastBuild = string.Empty;
            this.lastVerdict = string.Empty;

        }
        public string ID
        {
            get
            {
                return this.id;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.id = value;
                else
                    id = string.Empty;
            }
        }
        public string TestRef
        {
            get
            {
                return this.testref;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.testref = value;
                else
                    testref = string.Empty;
            }
        }

        public string Name
        {
            get
            {
                return this.name;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.name = value;
                else
                    name = string.Empty;
            }
        }
        public string Description
        {
            get
            {
                return this.description;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.description = value;
                else
                    description = string.Empty;
            }
        }
        public string Notes
        {
            get
            {
                return this.notes;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.notes = value;
                else
                    notes = string.Empty;
            }
        }
        public string Objective
        {
            get
            {
                return this.objective;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.objective = value;
                else
                    objective = string.Empty;
            }
        }
        public string Type
        {
            get
            {
                return this.type;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.type = value;
                else
                    type = string.Empty;
            }
        }
        public string Method
        {
            get
            {
                return this.method;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.method = value;
                else
                    method = string.Empty;
            }
        }
        public string Priority
        {
            get
            {
                return this.priority;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.priority = value;
                else
                    priority = string.Empty;
            }
        }
        public string Risk
        {
            get
            {
                return this.risk;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.risk = value;
                else
                    risk = string.Empty;
            }
        }
        public string Package
        {
            get
            {
                return this.package;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.package = value;
                else
                    package = string.Empty;
            }
        }
        public string PreConditions
        {
            get
            {
                return this.preConditions;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.preConditions = value;
                else
                    preConditions = string.Empty;
            }
        }
        public string PostConditions
        {
            get
            {
                return this.postConditions;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.postConditions = value;
                else
                    postConditions = string.Empty;
            }
        }
        public string ValidationInput
        {
            get
            {
                return this.validationInput;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.validationInput = value;
                else
                    validationInput = string.Empty;
            }
        }
        public string ValidationExpectedResult
        {
            get
            {
                return this.validationExpectedResult;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.validationExpectedResult = value;
                else
                    validationExpectedResult = string.Empty;
            }
        }
        public string Owner
        {
            get
            {
                return this.owner;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.owner = value;
                else
                    owner = string.Empty;
            }
        }
        public string LastVerdict
        {
            get
            {
                return this.lastVerdict;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.lastVerdict = value;
                else
                    lastVerdict = string.Empty;
            }
        }
        public string LastBuild
        {
            get
            {
                return this.lastBuild;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.lastBuild = value;
                else
                    lastBuild = string.Empty;
            }
        }
    }
    public class Defect
    {
        private string id;
        private string owner;
        private string defectRef;
        private string name;
        private string description;
        private string notes;
        private string state;
        private string environment;
        private string severity;
        private string priority;
        private string submittedBy;
        private string foundIn;
        private string fixedIn;
        private string targetBuild;
        private string verifiedIn;
        private string targetDate;
        private bool releaseNote;
        private bool affectsDoc;
        private Requirement requirement;
        private string resolution;
        private ArrayList attachmentList;
        private string revisionHistoryID;
        private string project;

        public Defect()
        {
            id = string.Empty;
            owner = string.Empty;
            defectRef = string.Empty;
            name = string.Empty;
            description = string.Empty;
            notes = string.Empty;
            state = string.Empty;
            environment = string.Empty;
            severity = string.Empty;
            priority = string.Empty;
            submittedBy = string.Empty;
            foundIn = string.Empty;
            fixedIn = string.Empty;
            targetBuild = string.Empty;
            verifiedIn = string.Empty;
            targetDate = string.Empty;
            releaseNote = false;
            affectsDoc = false;
            requirement = new Requirement();
            resolution = string.Empty;
            attachmentList = new ArrayList();
            revisionHistoryID = string.Empty;
            project = string.Empty;
        }

        public string Project
        {
            get
            {
                return this.project;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.project = value;
                else
                    project = string.Empty;
            } 
        }
       public string ID
        {
            get
            {
                return this.id;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.id = value;
                else
                    id = string.Empty;
            }
        }
        public string Owner
        {
            get
            {
                return this.owner;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.owner = value;
                else
                    owner = string.Empty;
            }
        }
        public string DefectRef
        {
            get
            {
                return this.defectRef;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.defectRef = value;
                else
                    defectRef = string.Empty;
            }
        }
        public string Name
        {
            get
            {
                return this.name;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.name = value;
                else
                    name = string.Empty;
            }
        }
        public string Description
        {
            get
            {
                return this.description;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.description = value;
                else
                    description = string.Empty;
            }
        }
        public string Notes
        {
            get
            {
                return this.notes;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.notes = value;
                else
                    notes = string.Empty;
            }
        }
        public string State
        {
            get
            {
                return this.state;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.state = value;
                else
                    state = string.Empty;
            }
        }
        public string Environment
        {
            get
            {
                return this.environment;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.environment = value;
                else
                    environment = string.Empty;
            }
        }
        public string Severity
        {
            get
            {
                return this.severity;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.severity = value;
                else
                    severity = string.Empty;
            }
        }
        public string Priority
        {
            get
            {
                return this.priority;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.priority = value;
                else
                    priority = string.Empty;
            }
        }
        public string SubmittedBy
        {
            get
            {
                return this.submittedBy;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.submittedBy = value;
                else
                    submittedBy = string.Empty;
            }
        }
        public string FoundIn
        {
            get
            {
                return this.foundIn;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.foundIn = value;
                else
                    foundIn = string.Empty;
            }
        }
        public string FixedIn
        {
            get
            {
                return this.fixedIn;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.fixedIn = value;
                else
                    fixedIn = string.Empty;
            }
        }
        public string TargetBuild
        {
            get
            {
                return this.targetBuild;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.targetBuild = value;
                else
                    targetBuild = string.Empty;
            }
        }
        public string VerifiedIn
        {
            get
            {
                return this.verifiedIn;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.verifiedIn = value;
                else
                    verifiedIn = string.Empty;
            }
        }
        public string TargetDate
        {
            get
            {
                return this.targetDate;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.targetDate = value;
                else
                    targetDate = string.Empty;
            }
        }
        public bool ReleaseNote
        {
            get
            {
                return this.releaseNote;
            }
            set
            {
                
                    this.releaseNote = value;
                
            }
        }
        public bool AffectsDoc
        {
            get
            {
                return this.affectsDoc;
            }
            set
            {
                
                    this.affectsDoc = value;
                
            }
        }
        public Requirement Requirement
        {
            get
            {
                return this.requirement;
            }
            set
            {
                if (value != null)
                this.requirement = value;
            }
        }

        public string Resolution
        {
            get
            {
                return this.resolution;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.resolution = value;
                else
                    resolution = string.Empty;
            }
        }

        public ArrayList AttachmentList
        {
            get
            {
                return this.attachmentList;
            }
            set
            {
                this.attachmentList = value;
            }
        }

        public string RevisionHistoryID
        {
            get
            {
                return this.revisionHistoryID;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    this.revisionHistoryID = value;
                else
                    revisionHistoryID = string.Empty;
            }
        }

    }

    public class Attachment
    {
        private string objectID;
        private string nameAttachment;
        private string dateAttachment;
        private string submittedBy;
        private string details;
        private string xmlWebString;

        public Attachment()
        {
            objectID = string.Empty;
            nameAttachment = string.Empty;
            dateAttachment = string.Empty;
            submittedBy = string.Empty;
            details = string.Empty;
            xmlWebString = string.Empty;
        }

        public  string ObjectID
        {
            get
            {
                return this.objectID;
            }
            set
            {
                this.objectID = value;

            }
        }

        public  string AttachmentName
        {
            get
            {
                return this.nameAttachment;
            }
            set
            {
                this.nameAttachment = value;

            }
        }

        public  string SubmittedBy
        {
            get
            {
                return this.submittedBy;
            }
            set
            {
                this.submittedBy = value;

            }
        }

        public  string DateAttachment
        {
            get
            {
                return this.dateAttachment;
            }
            set
            {
                this.dateAttachment = value;

            }
        }

        public  string Details
        {
            get
            {
                return this.details;
            }
            set
            {
                this.details = value;

            }
        }

        public string XMLWebString
        {
            get
            {
                return this.xmlWebString;
            }
            set
            {
                this.xmlWebString = value;

            }
        }
        
    }
    public class Task
    {
        private string id;
        private string name;
        private string taskRef;
        private string description;
        private string owner;
        private string project;
        private string state;
        private bool blocked;
        private string estimate;
        private string toDo;
        private string actuals;
        private string storyCard;
        private string storyCardRef;
        private string notes;
        private ArrayList attachmentList;

        public Task()
        {
            id = string.Empty;
            name = string.Empty;
            taskRef = string.Empty;
            description = string.Empty;
            owner = string.Empty;
            project = string.Empty;
            state = string.Empty;
            blocked = false;
            estimate = string.Empty;
            toDo = string.Empty;
            actuals = string.Empty;
            storyCard = string.Empty;
            notes = string.Empty;
            attachmentList = new ArrayList();
          
        }

        public string ID
        {
            get
            {
                return this.id;
            }
            set
            {
                if (value != null)
                this.id = value;

            }
        }
        public string Name
        {
            get
            {
                return this.name;
            }
            set
            {
                if (value != null)
                this.name = value;

            }
        }
        public string Description
        {
            get
            {
                return this.description;
            }
            set
            {
                if (value != null)
                this.description = value;

            }
        }
        public string Owner
        {
            get
            {
                return this.owner;
            }
            set
            {
                if (value != null)
                this.owner = value;

            }
        }
        public string Project
        {
            get
            {
                return this.project;
            }
            set
            {
                if (value != null)
                this.project = value;

            }
        }
        public string State
        {
            get
            {
                return this.state;
            }
            set
            {
                if (value != null)
                this.state = value;

            }
        }
        public bool Blocked
        {
            get
            {
                return this.blocked;
            }
            set
            {
                this.blocked = value;

            }
        }
        public string Estimate
        {
            get
            {
                return this.estimate;
            }
            set
            {
                if (value != null)
                this.estimate = value;

            }
        }
        public string ToDO
        {
            get
            {
                return this.toDo;
            }
            set
            {
                if (value != null)
                this.toDo = value;

            }
        }
        public string Actuals
        {
            get
            {
                return this.actuals;
            }
            set
            {
                if (value != null)
                this.actuals = value;

            }
        }
        public string StoryCard
        {
            get
            {
                return this.storyCard;
            }
            set
            {
                this.storyCard = value;

            }
        }
        public string Notes
        {
            get
            {
                return this.notes;
            }
            set
            {
                if (value != null)
                this.notes = value;

            }
        }
        public string TaskRef
        {
            get
            {
                return this.taskRef;
            }
            set
            {
                if (value != null)
                this.taskRef = value;

            }
        }
        public ArrayList AttachmentList
        {
            get
            {
                return this.attachmentList;
            }
            set
            {
                this.attachmentList = value;
            }
        }
        public string StoryCardRef
        {
            get
            {
                return this.storyCardRef;
            }
            set
            {
                if (value != null)
                this.storyCardRef = value;

            }
        }
    }
    public class DefectDataCache
    {
        private Hashtable defectData = new Hashtable();
        private string cacheTimeStamp;
        private Hashtable updatedDefectList = new Hashtable();

        public DefectDataCache()
        {
            cacheTimeStamp = string.Empty;
        }

        public Hashtable DefectCache
        {

            get
            {
                return this.defectData;

            }
            set
            {
                this.defectData = value;
            }

        }
        public string CacheTimeStamp
        {
            get
            {
                return this.cacheTimeStamp;
            }
            set
            {
                this.cacheTimeStamp = value;
            }
        }
        public Hashtable UpdatedDefectList
        {

            get
            {
                return this.updatedDefectList;

            }
            set
            {
                this.updatedDefectList = value;
            }

        }
    }
    public class TaskDataCache
    {
        private Hashtable taskData = new Hashtable();
        private string cacheTimeStamp;

        public TaskDataCache()
        {
            cacheTimeStamp = string.Empty;
        }

        public Hashtable TaskCache
        {
            get
            {
                return this.taskData;
            }
            set
            {
                this.taskData = value;
            }

        }
        public string CacheTimeStamp
        {
            get
            {
                return this.cacheTimeStamp;
            }
            set
            {
                this.cacheTimeStamp = value;
            }
        }

    }
    public class Requirement
    {
        string name;
        string reference;
        public Requirement()
        {
            name = string.Empty;
            reference = string.Empty;
        }
        public string Name
        {
            get 
            {
                return this.name;
            }
            set
            {
                this.name = value;
            }
        }
        public string Reference
        {
            get
            {
                return this.reference;
            }
            set
            {
                this.reference = value;
            }
        }
    }

}
